﻿//===============================================================================
// PostSharp Poco implementation for EntityFramework
//===============================================================================
// Copyright © Ruurd Boeke.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PostSharp.Laos;
using System.Data.Metadata.Edm;

namespace EntityFrameworkContrib.PostSharp4EF
{
    /// <summary>
    /// Applied, will notify postsharp that the weaver needs to be called
    /// </summary>
    [Serializable]
    internal class EDMSubAspect : ILaosTypeLevelAspect
    {
        #region fields and properties
        internal string MetadataString { get; set; }
        internal string Provider { get; set; }
        #endregion

        #region ctor
        /// <summary>
        /// Initializes a new instance of the <see cref="EDMAttributesSubAspect"/> class.
        /// </summary>
        /// <param name="metadata">The metadata.</param>
        /// <param name="provider">The provider.</param>
        public EDMSubAspect(string metadata, string provider)
        {
          this.MetadataString = metadata;
          this.Provider = provider;  
        }
        #endregion

        #region ILaosTypeLevelAspect Members

        public void CompileTimeInitialize(Type type)
        {
        }

        public bool CompileTimeValidate(Type type)
        {
            return true;
        }

        public void RuntimeInitialize(Type type)
        {
        }

        #endregion

        #region ILaosWeavableAspect Members

        public int AspectPriority
        {
            get { return int.MinValue; }
        }

        #endregion



    }
}
